<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .title {
        color: #333;
        line-height: 2;
      }
      .title span {
        background: linear-gradient(to right, #fff, #f00, #000) no-repeat right
          bottom;
        background-size: 0 2px;
        transition: background-size 0.3s;
      }
      .title span:hover {
        background-position-x: left;
        background-size: 100% 2px;
      }
    </style>
  </head>
  <body>
    <h2 class="title">
      <span>十年后，你会发现CSS才是你永远都学不会的语言</span>
    </h2>
  </body>
</html>
